package hangban.com.maochang.impl;



import hangban.com.maochang.dao.AirInfoDiDao;
import hangban.com.maochang.pojo.AirInfo;
import hangban.com.maochang.util.BaseDao;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;


public class AirInfoDiDaoImpl extends BaseDao implements AirInfoDiDao {
    @Override
    public List<AirInfo> getSelectdi(String di) throws Exception {
        String sql="select * from Airinfo where  mudi=?";
        ResultSet rs = super.query(sql, new Object[]{di});
        List<AirInfo> airInfos=new ArrayList<>();
        while (rs.next()){
            AirInfo airInfo=new AirInfo();
            airInfo.setId(rs.getInt("id"));
            airInfo.setHangcard(rs.getInt("hangcard"));
            airInfo.setMudi(rs.getString("mudi"));
            airInfo.setDatefei(rs.getDate("datefei"));
            airInfos.add(airInfo);
        }
        closeAll(rs.getStatement().getConnection(),rs.getStatement(),rs);
        return airInfos;
    }
}
